package cn.tedu._03mvcboot01.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class BMIController {
    @RequestMapping("bmi")
    @ResponseBody
    public String bmi(Double height, Double weight){
        double result = weight / (height * height);
        if (result < 18.5){
            return "兄弟你瘦了";
        }
        if (result < 24){
            return "你是一个正常的人";
        }
        if (result < 27){
            return "您稍微有点胖";
        }

        return "坚持锻炼吧兄弟姐妹";
    }
}
